package com.zhu.testcase.hellodemo.web;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController//使用restcontroller，因为要返回数据
@RequestMapping("/hello")
public class HelloWorldController {
    private static final Logger logger = LoggerFactory.getLogger(HelloWorldController.class);

    @Autowired
    @Qualifier("namebean")
    String myName;


    @RequestMapping(value = "/world", method = RequestMethod.GET)
    public String hello() {
        return "helloWorld";
    }

    @RequestMapping(value = "/name", method = RequestMethod.GET)
    public String helloName() {
        return myName;
    }
}
